<?php
/*
 * mk script file created on 13-mag-2005
 * jaco_at_pixeldump_dot_org
 * reading svg file
 */

include("sample_utils.php");            // provides some utils and using mk

//$svgFN = "linuxtag.svg";				// various svg to try...
//$svgFN = "sample01.svg";				//
//$svgFN = "vgai01.svg";                //
//$svgFN = "tux.svg";                   //
//$svgFN = "tux_ungrouped.svg";  //
//$svgFN = "tiger.svg";                 //
//$svgFN = "three_hearts.svg";            //
//$svgFN = "powerpuff01.svg";           //
//$svgFN = "picasso_woman_vect01.svg";  //
//$svgFN = "pclinux.svg";               //
$svgFN = "helloworld.svg";

$swfFN = basename($svgFN, "svg") ."swf";

$sv = new MKSimpleSvgReader($svgFN);
$wd = $sv->get_svgWidth();				// get svg width
$hg = $sv->get_svgHeight();				// get svg height
$sd = $sv->update_tagData();            // get tag data
$po = $sv->update_place_tagData();		// get placing data

$swf = new MKSwf($swfFN);     // start a fresh swf
$swf->set_swfDir(SERVER_MKTMP);			// change default working dir
$swf->set_stageWidth($wd);				// set stage dimensions
$swf->set_stageHeight($hg);				//

$swf->add_tagData($sd);					// populate with shape
$swf->add_tagData($po);	                // place on stage
$swf->swf_output();	                    // save to disk

$swfHeader = $swf->fetch_assoc();

$str = render_swf_box($swfHeader, $imgDir, false);
$str .= "<br/><strong>" .$swfFN ." created in" .SERVER_MKTMP ."</strong></td></tr>";
echo show_content($str, basename(__FILE__));
?>
